drawTex

fun DrawContext.drawTex(id: Identifier, x: Int, y: Int, width: Int, height: Int)
  • Extension function to replicate drawGuiTexture from 1.20.2+. Will brute force render the texture passed as a "standard" texture by adding the necessary identifier path information (such as the .png).

    • This method is surely not very efficient. It is designed to be a porting feature.

    • @param id Identier - The sprite identifier (1.20.2+ style) for the image.

Author

fzzyhmstrs

Since

0.2.0

Parameters

x

Int - the x location of the texture

y

Int - the y location of the texture

width
  • the width of the texture

height
  • the height of the texture


fun DrawContext.drawTex(id: Identifier, x: Int, y: Int, width: Int, height: Int, color: Int)

Extension function to replicate drawGuiTexture from 1.20.2-1.21.1. Uses the RenderLayer.getGuiTextured method to fill in the function param

Author

fzzyhmstrs

Since

0.2.0

Parameters

id

Identifier - The sprite identifier for the image.

x

Int - the x location of the texture

y

Int - the y location of the texture

width
  • the width of the texture

height
  • the height of the texture

color
  • the color of the texture


fun DrawContext.drawTex(id: Identifier, x: Int, y: Int, width: Int, height: Int, alpha: Float)

Extension function to replicate drawGuiTexture from 1.20.2-1.21.1. Uses the RenderLayer.getGuiTextured method to fill in the function param

Author

fzzyhmstrs

Since

0.2.0

Parameters

id

Identifier - The sprite identifier for the image.

x

Int - the x location of the texture

y

Int - the y location of the texture

width
  • the width of the texture

height
  • the height of the texture

alpha
  • the texture transparency